<%= render :partial => 'calendar' %>
<%= render :partial => 'sidebar' %>

<h2><%# image_tag "movie.png" %>  <%= in_place_editor_field :event, :title %>

 </h2>
<div class="event">
<div class="event_body">
 <div id="time">
    <%= image_tag "appointment-soon.png" %><%=print_time(@event) %>
</div>
<div class="infoblock">
<p>
  <b>Режиссер:</b>
  <%=in_place_editor_field :event, :director %>
</p>

<p>
  <b>Где:</b>
  <%=in_place_editor_field :event, :place %>
</p>

<p>
  <b>Жанр:</b>
  <%=h @event.genre %>
</p>

<% if @event.imdb_id? %>
<p>
  <b>Imdb:</b>
  <%=h @event.imdb_id %>
</p>
<% end %>
</div>

<% if @event.body? %><p>
  <%=markdown @event.body %>
</p>
<% end -%>
</div>
<div class="event_footer"></div>
</div>

<div class="service">
[ <%= link_to 'Редактировать', edit_event_path(@event) %> | <%= link_to 'Назад', events_path %> ]
<span style="margin-left:200px">
<%= link_to_function "Комментарии:" , "Element.toggle('comments')" %>&nbsp;( <span id="ncomments">  <%= @event.comments.count %></span> )

<%= link_to_function "Добавить комментарий", "Element.toggle('comment_form'); $('comment_body').focus()" %>
</span>
<br/>
<div id="comments" style="display:none">
    <% for comment in @event.comments -%>
        <%= render :partial => "comment", :object => comment %>
    <% end %>
</div>
<br/>
<div id="comment_form" style="display:none">
 (<a href="http://daringfireball.net/projects/markdown/syntax">markdown enabled</a>)
<% form_remote_tag :url => {:action => "comment", :id => @event } do %>
    <%= text_area "comment", "body", :rows => 5, :cols => 50 %> <br/>
    <%= hidden_field(:comment, :user_id, {:value => current_user.id}) %>
    <%= submit_tag "Добавить!" %>
<% end %>
</div>
</div>
